# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Solar.V1.Model.SolarPanelConfig do
  @moduledoc """
  SolarPanelConfig describes a particular placement of solar panels on the roof.

  ## Attributes

  *   `panelsCount` (*type:* `integer()`, *default:* `nil`) - Total number of panels. Note that this is redundant to (the sum of) the corresponding fields in roof_segment_summaries.
  *   `roofSegmentSummaries` (*type:* `list(GoogleApi.Solar.V1.Model.RoofSegmentSummary.t)`, *default:* `nil`) - Information about the production of each roof segment that is carrying at least one panel in this layout. `roof_segment_summaries[i]` describes the i-th roof segment, including its size, expected production and orientation.
  *   `yearlyEnergyDcKwh` (*type:* `number()`, *default:* `nil`) - How much sunlight energy this layout captures over the course of a year, in DC kWh, assuming the panels described above.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :panelsCount => integer() | nil,
          :roofSegmentSummaries => list(GoogleApi.Solar.V1.Model.RoofSegmentSummary.t()) | nil,
          :yearlyEnergyDcKwh => number() | nil
        }

  field(:panelsCount)
  field(:roofSegmentSummaries, as: GoogleApi.Solar.V1.Model.RoofSegmentSummary, type: :list)
  field(:yearlyEnergyDcKwh)
end

defimpl Poison.Decoder, for: GoogleApi.Solar.V1.Model.SolarPanelConfig do
  def decode(value, options) do
    GoogleApi.Solar.V1.Model.SolarPanelConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Solar.V1.Model.SolarPanelConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
